package com.cxso.example.client;

import com.cxso.example.enums.ProductClientEnum;
import com.cxso.example.request.ocr.*;
import com.cxso.example.response.ocr.*;
import com.cxso.example.sdk.domain.Result;
import com.cxso.example.sdk.http.base.HttpMethod;
import com.cxso.example.sdk.http.client.Client;
import com.cxso.example.sdk.http.core.ChoiceClient;
import io.swagger.v3.oas.annotations.media.Schema;

@Schema(description = "图像识别服务")
public class OcrClient extends Client {

    public OcrClient(ChoiceClient choiceClient) {
        super(choiceClient);
    }

    @Schema(description = "身份证识别")
    public Result<OcrIdCardResponse> ocrIdCard(OcrIdCardRequest ocrIdCardRequest) {
        return choiceClient.choice(ProductClientEnum.SHARE_PC.getCode()).execute("/v4/api/ocr/operateIdCard", HttpMethod.POST, ocrIdCardRequest).toEntity(OcrIdCardResponse.class);
    }

    @Schema(description = "营业执照识别")
    public Result<OcrBusinessLicenseResponse> ocrBusinessLicense(OcrBusinessLicenseRequest ocrBusinessLicenseRequest) {
        return choiceClient.choice(ProductClientEnum.SHARE_PC.getCode()).execute("/v4/api/ocr/operateBusinessLicense", HttpMethod.POST, ocrBusinessLicenseRequest).toEntity(OcrBusinessLicenseResponse.class);
    }

    @Schema(description = "银行卡识别")
    public Result<OcrBankCardResponse> ocrBankCard(OcrBankCardRequest ocrBankCardRequest) {
        return choiceClient.choice(ProductClientEnum.SHARE_PC.getCode()).execute("/v4/api/ocr/operateBankCard", HttpMethod.POST, ocrBankCardRequest).toEntity(OcrBankCardResponse.class);
    }

    @Schema(description = "驾驶证正面识别")
    public Result<OcrDriverLicenseResponse> ocrDriverLicense(OcrDriverLicenseRequest ocrDriverLicenseRequest) {
        return choiceClient.choice(ProductClientEnum.SHARE_PC.getCode()).execute("/v4/api/ocr/operateDriverLicense", HttpMethod.POST, ocrDriverLicenseRequest).toEntity(OcrDriverLicenseResponse.class);
    }

    @Schema(description = "行驶证识别")
    public Result<OcrDrivingLicenseResponse> ocrDrivingLicense(OcrDrivingLicenseRequest ocrDrivingLicenseRequest) {
        return choiceClient.choice(ProductClientEnum.SHARE_PC.getCode()).execute("/v4/api/ocr/operateDrivingLicense", HttpMethod.POST, ocrDrivingLicenseRequest).toEntity(OcrDrivingLicenseResponse.class);
    }

    @Schema(description = "银行回单识别")
    public Result<OcrBankReceiptResponse> ocrBankReceipt(OcrBankReceiptRequest ocrBankReceiptRequest) {
        return choiceClient.choice(ProductClientEnum.SHARE_PC.getCode()).execute("/v4/api/ocr/operateBankReceipt", HttpMethod.POST, ocrBankReceiptRequest).toEntity(OcrBankReceiptResponse.class);
    }

    @Schema(description = "道路运输从业资格证识别")
    public Result<OcrQualificationCertificateResponse> ocrQualificationCertificate(OcrQualificationCertificateRequest ocrQualificationCertificateRequest) {
        return choiceClient.choice(ProductClientEnum.SHARE_PC.getCode()).execute("/v4/api/ocr/operateQualificationCertificate", HttpMethod.POST, ocrQualificationCertificateRequest).toEntity(OcrQualificationCertificateResponse.class);
    }

    @Schema(description = "道路运输证识别")
    public Result<OcrTransportationLicenseResponse> ocrTransportationLicense(OcrTransportationLicenseRequest ocrTransportationLicenseRequest) {
        return choiceClient.choice(ProductClientEnum.SHARE_PC.getCode()).execute("/v4/api/ocr/operateTransportationLicense", HttpMethod.POST, ocrTransportationLicenseRequest).toEntity(OcrTransportationLicenseResponse.class);
    }

    @Schema(description = "通用文字识别")
    public Result<OcrAccurateBasicResponse> ocrAccurateBasic(OcrAccurateBasicRequest ocrAccurateBasicRequest) {
        return choiceClient.choice(ProductClientEnum.SHARE_PC.getCode()).execute("/v4/api/ocr/operateAccurateBasic", HttpMethod.POST, ocrAccurateBasicRequest).toEntity(OcrAccurateBasicResponse.class);
    }
}
